<template>
  <view :style="themeColor">
    <view class="page">
      <fu-custom bgColor="bg-white" :isBack="true" :isBottom="true">
        <block slot="content">我要加盟</block>
      </fu-custom>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center woyaojiameng_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch woyaojiameng_fd1_0'>
          <text class='woyaojiameng_fd1_0_c0'>合作意向</text>
          <view class='flex flex-wrap woyaojiameng_fd1_0_c1'>
            <textarea class='flex woyaojiameng_input_fd1_0_c1' :placeholder="'将您的合作意向告诉我们吧…'" :maxlength="240"
              :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="cooperation_intention" />
            <template>
              <view class='flex flex justify-end woyaojiameng_numberfd1_0_c1_c0'>
                <text>{{cooperation_intention.length}}</text>
                <text class='woyaojiameng_numberfd1_0_c1_c0_c1'>/</text>
                <text>240</text>
              </view>
            </template>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='woyaojiameng_fd1_0_c0'>图片/视频</text>
          </view>
          <benben-images-upload ref="benbenImagesUploadfd1_0_c3" :img-list.sync="imgs" :img-ids.sync="files"
            :maxlength="9">
            <template #content="{ num, maxlength, isShow, imgList }">
              <view class="flex flex-wrap align-start flex woyaojiameng_fd1_0_c3">

                <view v-for="(image, index) in imgList" :key="index"
                  class='flex position-relative woyaojiameng_fd1_0_c30'>
                  <text class='fu-iconfont2 position-absolute woyaojiameng_fd1_0_c300'
                    @tap.stop="$refs.benbenImagesUploadfd1_0_c3.delImage(index)">&#xE8E7;</text>
                  <image class='woyaojiameng_fd1_0_c301'
                    @tap.stop="$refs.benbenImagesUploadfd1_0_c3.previewImage(index)" mode="aspectFill" :src='image'>
                  </image>
                </view>

                <image class='woyaojiameng_fd1_0_c31' @tap.stop="$refs.benbenImagesUploadfd1_0_c3.manyChooseImage()"
                  v-if="isShow" mode="aspectFill" :src='STATIC_URL+"509.png"'></image>

              </view>
            </template>
          </benben-images-upload>
        </view>
        <view class='flex flex-wrap align-center woyaojiameng_fd1_1'>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch woyaojiameng_fd1_0'>
          <view class='flex flex-wrap align-center'>
            <text class='woyaojiameng_fd1_0_c0'>联系信息</text>
          </view>
          <view class='flex flex-wrap align-center woyaojiameng_fd1_2_c1'>
            <text class='woyaojiameng_fd1_2_c1_c0'>姓名</text>
            <input type="text" :placeholder="`请输入`" confirm-type="done" :maxlength="10"
              placeholder-style="color:#999;font-size:28rpx" v-model="username" />
          </view>
          <view class='flex flex-wrap align-center woyaojiameng_fd1_2_c1'>
            <text class='woyaojiameng_fd1_2_c1_c0'>手机号</text>
            <input type="tel" :placeholder="`请输入`" confirm-type="done" :maxlength="11"
              placeholder-style="color:#999;font-size:28rpx" v-model="mobile" />
          </view>
        </view>
        <button class='woyaojiameng_fd1_3' @tap.stop="submitFunc()">提交</button>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "cooperation_intention": "",
        "files": "",
        "username": "",
        "mobile": "",
        "imgs": []
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //提交
      async submitFunc() {
        if (!validate(this.cooperation_intention, 'require')) {
          this.$message.info('合作描述不能为空');
          return false;
        }
        if (!validate(this.files, 'require')) {
          this.$message.info('请上传图片');
          return false;
        }
        if (!validate(this.username, 'require')) {
          this.$message.info('请输入姓名');
          return false;
        }
        if (!validate(this.mobile, 'require')) {
          this.$message.info('请输入联系方式');
          return false;
        }
        if (!validate(this.mobile, 'phone')) {
          this.$message.info('请输入正确的手机号');
          return false;
        }
        //请求方法
        //数据验证

        let data65712a0fc2c79 = await this.$api.post(global.apiUrls.post65712a0fc2c79, {
          cooperation_intention: this.cooperation_intention,
          files: this.files,
          username: this.username,
          mobile: this.mobile
        });

        if (data65712a0fc2c79.data.code != 1) {
          this.$message.info(data65712a0fc2c79.data.msg);
          return
        }



        this.$urouter.navigateTo(`/pages/sy/tijiaojieguo/tijiaojieguo?order_sn=`);
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .woyaojiameng_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .woyaojiameng_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333333;
    line-height: 88rpx;
  }

  .woyaojiameng_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .woyaojiameng_fd0_0_c0 {
    width: 120rpx;
  }

  .woyaojiameng_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .woyaojiameng_flex_1 {
    padding: 0rpx 0rpx 0rpx 0rpx;
  }

  .woyaojiameng_fd1_3 {
    background: var(--benbenbgColor7);
    border-radius: 33rpx 33rpx 33rpx 33rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    margin: 100rpx auto 0rpx auto;
  }

  .woyaojiameng_fd1_2_c1_c0 {
    color: #1A1A1A;
    font-size: 32rpx;
    font-weight: 500;
    width: 120rpx;
  }

  .woyaojiameng_fd1_2_c1 {
    border-bottom: 1px solid #eee;
    line-height: 88rpx;
    height: 88rpx;
  }

  .woyaojiameng_fd1_1 {
    background: #f8f8f8;
    background-size: 100% auto;
    width: 750rpx;
    height: 20rpx;
  }

  .woyaojiameng_fd1_0_c31 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .woyaojiameng_fd1_0_c301 {
    width: 160rpx;
    height: 160rpx;
  }

  .woyaojiameng_fd1_0_c300 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .woyaojiameng_fd1_0_c30 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .woyaojiameng_fd1_0_c3 {
    width: 750rpx;
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .woyaojiameng_numberfd1_0_c1_c0_c1 {
    color: var(--benbenFontColor0);
  }

  .woyaojiameng_numberfd1_0_c1_c0 {
    width: 100%;
    font-size: 24rpx;
    color: var(--benbenFontColor0);
    line-height: 46rpx;
    font-weight: 400;
  }

  .woyaojiameng_input_fd1_0_c1 {
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .woyaojiameng_fd1_0_c1 {
    background: #F8F9FD;
    padding: 10rpx 10rpx 0rpx 16rpx;
    border-radius: 16rpx;
    width: 686rpx;
  }

  .woyaojiameng_fd1_0_c0 {
    color: #1A1A1A;
    font-size: 32rpx;
    font-weight: 500;
    margin: 32rpx 0rpx 24rpx 0rpx;
  }

  .woyaojiameng_fd1_0 {
    width: 686rpx;
    margin: 0rpx auto 0rpx auto;
  }
</style>